<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="head.jsp" />
<link rel="stylesheet" type="text/css" href="${path}/css/monitor-app.min.css?" />
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
				<a href="main" title="Go to Home" class="tip-bottom"><i
					class="icon-home"></i> Home</a> <a href="appMain">Application</a> 
					<a href="#" class="current">
					   <c:if test="${not empty appId}">
					         App Edit
					   </c:if>
					   <c:if test="${appId == null}">
					         App Insert
					   </c:if>
					</a>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-info-sign"></i></span>
						<h5>
						  <c:if test="${not empty appId}">
					         App Edit 
					      </c:if>
					      <c:if test="${appId == null}">
					         App Insert
					      </c:if>
					    </h5>
					</div>
					<div class="widget-content nopadding">
						<form class="form-horizontal" method="post" action="doAppAction" name="basic_validate" id="basic_validate" novalidate="novalidate">
								<input type="hidden" name="appId" value="${appId}" />
								<div class="control-group">
									<label class="control-label">应用名称</label>
									<div class="controls">
										<input type="text" placeholder="请输入应用的名称....." data-title="应用名称必须同注册到监控服务的应用名称一致." data-placement="right" class="span11 tip" data-original-title="" name="appName" id="appName" value="${app.appName}">
									</div>
								</div>
								<div class="control-group">
									<label class="control-label">应用描述</label>
									<div class="controls">
										<input type="text" placeholder="请输入应用的描述....." data-title="请填写应用的中文名称." data-placement="right" class="span11 tip" data-original-title="" name="appDesc" id="appDesc" value="${app.appDesc}">
									</div>
								</div>
								
								<c:if test="${not empty app.appStatus}">
									<c:if test="${app.appStatus == 'off'}">   
								    <div class="control-group">
									  <label class="control-label">生效时间</label>
									  <div class="controls">
									      <select name="effectiveInterval" id="effectiveInterval">
											<option value="3" <c:if test="${app.effectiveInterval == 3}">selected="selected"</c:if>>3分钟后</option>
											<option value="5" <c:if test="${app.effectiveInterval == 5}">selected="selected"</c:if>>5分钟后</option>
											<option value="10" <c:if test="${app.effectiveInterval == 10}">selected="selected"</c:if>>10分钟后</option>
											<option value="15" <c:if test="${app.effectiveInterval == 15}">selected="selected"</c:if>>15分钟后</option>
										  </select>
									  </div>
								    </div>
								  </c:if>
							    </c:if>
								
								<c:if test="${empty app.appStatus}">
								    <div class="control-group">
									  <label class="control-label">生效时间</label>
									  <div class="controls">
									      <select name="effectiveInterval" id="effectiveInterval">
											<option value="3">3分钟后</option>
											<option value="5">5分钟后</option>
											<option value="10">10分钟后</option>
											<option value="15">15分钟后</option>
										  </select>
									  </div>
								    </div>
							    </c:if>
									 
								<div class="control-group">
									<label class="control-label">实例数</label>
									<div class="controls">
										<input type="text" placeholder="请输入应用的实例数....." data-title="应用实例数必须为生产上真实的Instance数." data-placement="right" class="span11 tip" data-original-title="" name="appInstanceNum" id="appInstanceNum" value="${app.appInstanceNum}">
									</div>
								</div>
								
								<div class="control-group">
									<label class="control-label">应用负责人</label>
									<div class="controls">
										<select name="userIds" id="userIds" multiple>
										 <c:forEach items="${userList}" var="user"> 
						                    <option value="${user.id}" <c:if test="${user.selectValue =='true'}">selected="selected"</c:if>> ${user.userName}</option>
										 </c:forEach>  
						               </select>
									</div>
								</div>
								
					            <div class="form-actions">
					            <c:if test="${not empty appId}">
					               <button type="submit" class="btn btn-info">Edit</button>
					            </c:if>
					            <c:if test="${appId == null}">
					                <button type="submit" class="btn btn-success">Save</button>
	                            </c:if>
	                            <input type="button" name="Button"  value="Cancle" class="btn btn-danger" onClick="javascript:history.back()">
					            </div>
          
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<jsp:include page="footer.jsp" />
<script src="${path}/js/monitor-app.min.js"></script>
</body>
</html>